package com.huang.design.creatation.singleton;

public class Person {
    private String name;

    private static volatile   Person person;

    private Person() {
        System.out.println("创建了person");
    }

    public static Person getPerson(){
        if(person==null){
            synchronized (Person.class){
                if(person==null){
                    person=new Person();
                    return  person;
                }
            }
        }
         return  person;
    }

}
